function headPage() {
	var nowpage = document.getElementById("pageno");
	if (nowpage.value <= 1) {
		window.alert("已经是第一页了");
		return;
	}
	nowpage.value = 1;
	document.getElementById("pageForm").submit();
}
function upPage() {
	var nowpage = document.getElementById("pageno");
	if (nowpage.value <= 1) {
		window.alert("已经是第一页了");
		return;
	}
	nowpage.value = parseInt(nowpage.value) - 1;
	document.getElementById("pageForm").submit();
}
function nextPage() {
	var nowpage = document.getElementById("pageno");
	var maxpage = document.getElementById("maxpage");
	if (maxpage.value <= 0 || nowpage.value == maxpage.value) {
		window.alert("已经是最后一页了");
		return;
	}
	nowpage.value = parseInt(nowpage.value) + 1;
	document.getElementById("pageForm").submit();
}
function lastPage() {
	var nowpage = document.getElementById("pageno");
	var maxpage = document.getElementById("maxpage");
	if(maxpage.value <= 0||nowpage.value==maxpage.value){
    	window.alert("已经是最后一页了!");
    	return;
    }
	nowpage.value=maxpage.value;
	document.getElementById("pageForm").submit();
}
function goPage(pageno){
	var nowpage = document.getElementById("pageno");
	if(nowpage.value == pageno){
		return ;
	}
	nowpage.value = pageno;
	document.getElementById("pageForm").submit();
}
function gotoPage() {
	var gp = document.getElementById("gopage");
	var t = /^\d+$/;
	if(!t.test(gp.value)){
		window.alert('输入的页码不正确,请输入数字');
		return;
	}
	var nowpage = document.getElementById("pageno");
	var maxpage = document.getElementById("maxpage");
	if(gp.value == nowpage.value){
		window.alert('输入的页码为当前页,请输入其他页码');
		return ;
	}
	if (parseInt(gp.value) >parseInt(maxpage.value) || parseInt(gp.value) < 1) {
		window.alert("输入页码不正确");
		return;
	}
	nowpage.value = gp.value;
	document.getElementById("pageForm").submit();
}

